﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace 生成XML
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(GetXML());
        }
        public static string GetXML()
        {
            string clientcode = "WB";
            string servicecode = "ImageCenter";
            string servername = "STARTWORKFLOW";
            string djbh = "djbh20181211";
            XDocument doc = null;

            #region  组织XML
            doc = new XDocument(
                    new XDeclaration("1.0", "utf-8", null),
                    new XElement("params",
                        new XElement("safety",
                            new XElement("clientcode", clientcode),
                            new XElement("servicecode", servicecode),
                            new XElement("time", 20181211161833),
                            new XElement("ticket", string.Empty)),
                                new XElement("serverbody",
                                    new XElement("servername", servername),
                                    new XElement("servertype", string.Empty),
                                        new XElement("services",
                                            new XElement("service",
                                                new XElement("serviceid", string.Empty),
                                                new XElement("barcode", djbh),
                                                new XElement("type", 1),
                                                new XElement("useraccount", string.Empty),
                                                new XElement("username", string.Empty),
                                                new XElement("phone", string.Empty),
                                                new XElement("remark", "退费单审批稽核不通过时，删除影像"),
                                                new XElement("billtype", 1)
                                                )))));
            string inXml = String.Format("{0}\r\n{1}", doc.Declaration.ToString(), doc.ToString());
            //ImageWebService image = new ImageWebService();
            //string outXML=image.ImageInterfaceService(inXml);
            return inXml;

            #endregion

        }
    }
}
